﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Shared/ContentMaster.master"
    CodeFile="messageList.aspx.cs" Inherits="ltMan_messages_messageList" %>
<%@ Register src="PublicCommandEx.ascx" tagname="PublicCommandEx" tagprefix="uc1" %>
<asp:Content ID="C1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="C2" ContentPlaceHolderID="CPH1" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script>
            var win1;
            function openCWin(parm) {
                win1 = radopen('messageReply.aspx?id=' + parm);
                win1.setSize(530, 530);
                win1.Center();
                win1.set_title('回复留言');
            }
            function reloadData() {
                if (win1)
                    win1.close();
                $find('<%=RadGrid1.ClientID %>').get_masterTableView().rebind();
            }
            function goEdit(row) {
                var id = row.getDataKeyValue("eid");
                openCWin(id);
            }
            Sys.Application.add_load(function () {
                $('.icon-reply').click(function () {
                    openCWin($(this).attr('eid'));
                });
            });
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManagerProxy runat="server" ID="proxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="b1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <div class="searchArea">
        主题：<telerik:RadTextBox EmptyMessage="搜索主题" ID="sName" runat="server" MaxLength="50" />
        <telerik:RadButton Icon-PrimaryIconCssClass="icon-search" runat="server" ID="b1"
            OnClick="b1_Click" Text="搜索" />        
    </div>
    <telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" OnDeleteCommand="RadGrid1_DeleteCommand"
        OnItemCommand="RadGrid1_ItemCommand" PageSize="12">
        <ClientSettings>
            <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="340" />
        </ClientSettings>
        <MasterTableView CommandItemDisplay="Top" EditMode="PopUp" DataKeyNames="id" ClientDataKeyNames="id">
            <CommandItemTemplate>
                <telerikEx:GridCommandEx ID="GridCommandEx1" runat="server" OnEditClicking="goEdit"
                    ShowAdd="false" ShowEdit="false" /><span class="pad3blk">
                <telerikEx:VerifyCommandEx ID="VerifyCommandEx1" runat="server" />
                <uc1:PublicCommandEx ID="PublicCommandEx1" runat="server" /></span>
            </CommandItemTemplate>
            <PagerTemplate>
                <telerikEx:RadPagerEx ID="RadPagerEx1" runat="server" />
            </PagerTemplate>
            <Columns>
                <telerik:GridClientSelectColumn HeaderStyle-Width="28" ItemStyle-Width="28" />
                <telerik:GridBoundColumn DataField="id" Visible="false" />
                <%--<telerik:GridBoundColumn HeaderStyle-Width="70" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="查询码" DataField="qcode" DataFormatString="<nobr>{0}</nobr>" />--%>
                <telerik:GridBoundColumn HeaderText="主题" DataField="title" DataFormatString="<nobr>{0}</nobr>" />
                <telerik:GridBoundColumn HeaderStyle-Width="70" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="发布人" DataField="username" DataFormatString="<nobr>{0}</nobr>" />
                <telerik:GridBoundColumn HeaderStyle-Width="70" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="回复人" DataField="relren" DataFormatString="<nobr>{0}</nobr>" />
                <telerik:GridBoundColumn HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="Center"
                    HeaderText="发布时间" DataField="addtime" DataFormatString="{0:yyyy-MM-dd}" />
                <telerik:GridBoundColumn HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="点击数" DataField="hits" />
                <telerik:GridTemplateColumn HeaderStyle-Width="150" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="状态" SortExpression="sh,tj">
                    <ItemTemplate>
                        <%#Convert.ToInt32(Eval("zt")) == 0?"未审核":"<font color=#ff0000>已审核</font>"%>
                        <%#Eval("rel").ToString().Trim()!=""?"<font color=#ff0000>已回复</font>":"未回复"%>
                        <%#Convert.ToBoolean(Eval("inPublic")) ? "<font color=#ff0000>已公开</font>" : "未公开"%>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderStyle-Width="50" HeaderStyle-HorizontalAlign="Center"
                    ItemStyle-HorizontalAlign="Center" HeaderText="回复">
                    <ItemTemplate>
                        <asp:LinkButton CssClass="icon icon-reply" Style="padding-right: 2px;" runat="server"
                            ToolTip="回复" eid='<%# Eval("id") %>' />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>